x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid()
authorJan Beulich <jbeulich@suse.com>
Thu, 22 Jan 2015 11:48:40 +0000 (12:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Jan 2015 11:48:40 +0000 (12:48 +0100)
Only the low 32 bits are relevant.

For consistency also change a cast on regs->eax to regs->_eax.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/traps.c

index bd04dad4877aabc89cd5594388fcc7c53e52ca6c..a8d7bb673b5edca52198bb8b3e71095ad101d81e 100644 (file)
@@ -881,7 +881,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         }
     }
 
-    switch ( (uint32_t)regs->eax )
+    switch ( regs->_eax )
     {
     case 0x00000001:
         /* Modify Feature Information. */
@@ -916,7 +916,7 @@ void pv_cpuid(struct cpu_user_regs *regs)
         break;
 
     case 0x00000007:
-        if ( regs->ecx == 0 )
+        if ( regs->_ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
                   cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |